<template>
  <div class="home">
    <router-view class="fix"></router-view>
    <div class="tabbar">
      <router-link custom to="/index" v-slot="{ navigate,isExactActive}">
        <span @click="navigate" :class="{active:isExactActive}">外卖</span>
      </router-link>
      <router-link custom to="/search" v-slot="{ navigate,isExactActive}">
        <span @click="navigate" :class="{active:isExactActive}">搜索</span>
      </router-link>
      <router-link custom to="/order" v-slot="{ navigate,isExactActive}">
        <span @click="navigate" :class="{active:isExactActive}">订单</span>
      </router-link>
      <router-link custom to="/user" v-slot="{ navigate,isExactActive}">
        <span @click="navigate" :class="{active:isExactActive}">我的</span>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  components: {
  }
}
</script>
<style lang="scss" scoped>
  .home{
    height: 100%;
  }
  .fix{
    height: calc(100% - 50px);
  }
  .tabbar{
    display: flex;
    height: 50px;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #ccc;
    .active{
      color: #2a74f5;
    }
  }
</style>
